home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 1 / Cream of the Crop 1.iso / BUSINESS / SPC11.ARJ / SPCPAPER.PGH < prev    next >
Text File  |  1992-01-20  |  61KB  |  1,514 lines

  1. @
  2. paper
  3. APPLICATION OF MACHINE LEARNING AND EXPERT SYSTEMS TO STATISTICAL
  4.          PROCESS CONTROL (SPC) CHART INTERPRETATION
  5.  
  6.                   #mMark Shewhart#m
  7.  
  8. This paper consists  of the following sections :
  9.  
  10.         #m(-)#m ABSTRACT
  11.         #m(0)#m INTRODUCTION
  12.         #m(1)#m CONTROL CHARTS
  13.         #m(2)#m SOFTWARE FUNCTIONALITY
  14.         #m(3)#m SOFTWARE DESIGN
  15.         #m(4)#m MACHINE LEARNING
  16.         #m(5)#m EXPERT SYSTEM
  17.         #m(6)#m CONCLUSION
  18.         #mREFERENCES#m        
  19.         #mAttachment A#m
  20.         #mAttachment B#m
  21.  
  22.  
  23.         Abstract.  Statistical Process Control (SPC) Charts are one
  24.         of several tools used in Quality Control.  Other tools
  25.         include flow charts, histograms, cause-and-effect diagrams,
  26.         check sheets, Pareto diagrams, graphs, and scatter diagrams. 
  27.         A control chart is simply a graph which indicates process
  28.         variation over time.  The purpose of drawing a control chart
  29.         is to detect any changes in the process, signalled by
  30.         abnormal points or patterns on the graph.  The Artificial
  31.         Intelligence Support Center (AISC) of the Acquisition
  32.         Logistics Division (ALD/JTI) has developed a hybrid machine-
  33.         learning/expert-system prototype which automates the process
  34.         of constructing and interpreting control charts.
  35.  
  36.  
  37. INTRODUCTION
  38.  
  39. The Air Force Logistics Command (AFLC) has provided TQM and Quality
  40. Control training to its employees for several years now.  In
  41. particular, Statistical Process Control has been emphasized in this
  42. effort.  While many data collection efforts have been undertaken
  43. within AFLC, the SPC Quality Control tool has been under-utilized
  44. due to the lack of experienced personnel to identify and interpret
  45. patterns within the control charts.  The AISC has developed a
  46. prototype software tool which draws control charts, identifies
  47. various chart patterns, advises what each pattern means, and
  48. suggests possible corrective actions.  The application is easily
  49. modifiable for process specific applications through simple
  50. modifications to the knowledge base portion using any word
  51. processing software.
  52.  
  53. The remainder of this paper consists  of the following sections :
  54.  
  55.         #m(1)#m CONTROL CHARTS
  56.         #m(2)#m SOFTWARE FUNCTIONALITY
  57.         #m(3)#m SOFTWARE DESIGN
  58.         #m(4)#m MACHINE LEARNING
  59.         #m(5)#m EXPERT SYSTEM
  60.         #m(6)#m CONCLUSION
  61.         #mREFERENCES#m        
  62.         #mAttachment A#m
  63.         #mAttachment B#m
  64.  
  65. Section (1) provides a more in-depth explanation of the purpose of
  66. control charts.  Section (2) details the initial functional
  67. requirements for the SPC software, and section (3) outlines the
  68. design approach used to implement the system requirements. 
  69. Sections (4) and (5) examine in detail the roles of machine
  70. learning and expert system techniques respectively.  Finally,
  71. section (6) offers some basic conclusions resulting from this
  72. effort.   Two attachments are included after the references. 
  73. ATTACHMENT A provides a list of the chart patterns of interest and
  74. their methods of identification.  ATTACHMENT B enumerates and
  75. explains the twenty statistical features used by the machine
  76. learning tool.
  77.  
  78. CONTROL CHARTS
  79.  
  80. An example of a control chart is given below in FIGURE 1.  A run
  81. chart is a plot of a process measurement (e.g. bore diameter or
  82. time to process an insurance claim for example) on the vertical
  83. axis (y-axis) against time on the horizontal axis (x-axis).  A
  84. control chart is simply a run chart with statistically determined
  85. upper (Upper Control Limit - UCL) and lower (Lower Control Limit -
  86.  LCL) lines drawn on either side of the process average.  These
  87. limits are calculated by running a process untouched, taking
  88. samples of the process measurement, and applying the appropriate
  89. statistical formulas (references [3-9]).
  90.  
  91. The random fluctuation of points within the limits results from
  92. variation built into the process.  Such random variation is
  93. natural, results from common causes within the system (e.g. design,
  94. choice of machine, preventative maintenance, etc.), and can only
  95. be affected by changing the system itself.  However, points which
  96. fall outside of the control limits or which form "unnatural"
  97. patterns indicate that some of the variation within the process may
  98. be due assignable causes.  Assignable causes of variation (e.g.
  99. measurement errors, unplanned events, freak occurrences, etc.) can
  100. be identified and result from occurrences that are not part of the
  101. process.
  102.  
  103. The purpose of drawing the control chart is to detect any unusual
  104. causes of variation in the process, signalled by abnormal points
  105. or patterns on the graph.  The AISC developed software tool
  106. automatically identifies nine types of patterns which indicate the
  107. presence of assignable causes of variation in a process.  Examples
  108. of these patterns are given in FIGURES 2 - 10.  Each such pattern
  109. is associated with generic advice about what may be happening at
  110. that point in the process.  More detailed information about each
  111. of the nine patterns is given in ATTACHMENT A.
  112.  
  113.  
  114. SOFTWARE FUNCTIONALITY
  115.  
  116. An overview of the functionality of the application (referred to
  117. as SPC) is given below :
  118.  
  119.         (1) SPC determines which type of control chart is
  120.         appropriate by asking a series of questions about the nature
  121.         of the user's process data.  The appropriate control chart
  122.         is selected from the following types of charts (See
  123.         References [3,4,5,6]) :
  124.  
  125.                   (a) X-Bar R Chart
  126.                   (b) p Chart
  127.                   (c) pn Chart
  128.                   (d) u Chart
  129.                   (e) c Chart
  130.  
  131.         (2) SPC graphically displays the chart(s) selected in (1).
  132.  
  133.         (3) SPC identifies the following patterns in the chart(s)
  134.         which indicate the presence of assignable causes of
  135.         variation :
  136.  
  137.                   (a) increasing trends
  138.                   (b) decreasing trends
  139.                   (c) shifts up
  140.                   (d) shifts down
  141.                   (e) cycles
  142.                   (f) runs
  143.                   (g) stratification
  144.                   (h) freak patterns
  145.                   (i) freak points
  146.  
  147.         (4) SPC graphically displays and highlights each chart
  148.         pattern  identified in (3).
  149.  
  150.         (5) SPC displays text in a window-like fashion which
  151.         provides generic advice on the meaning of each chart pattern
  152.         identified in (3).
  153.  
  154.  
  155. SOFTWARE DESIGN
  156.  
  157. The basic approach to developing SPC was to integrate machine
  158. learning, expert systems, and conventional programming techniques. 
  159. The machine learning portion of SPC was developed using the
  160. Abductory Induction Mechanism (AIM) by AbTECH Inc.  The expert
  161. system portion of SPC was developed using an embedded application
  162. of the forward chaining expert system tool CLIPS along with a
  163. generic end-user interface also developed by the AISC.  Turbo C++
  164. was used as the conventional language into which the machine
  165. learning and expert system applications were embedded.
  166.  
  167. The task for the machine learning portion of SPC is to classify
  168. every sub-sequence of the control chart according to the presence
  169. or absence of five specific chart patterns : increasing trends,
  170. decreasing trends, shifts up, shifts down, and cycles.  The
  171. remaining four chart patterns are identified by conventional
  172. methods.
  173.  
  174. The expert system is initially utilized to help the user select the
  175. appropriate type of control chart.  This determination is based
  176. upon the type of data being collected and the constancy of the
  177. sample sizes.
  178.  
  179. Another function of the expert system is to interpret the
  180. classification results of the trained AIM Network.  A control chart
  181. with 40 data points will generate over 600 classification results;
  182. with nine types of patterns this amounts to over 5500 individual
  183. pieces of classification information.  This interpretation function
  184. represents an ideal expert system application.  What requires a few
  185. hundred lines of difficult-to-comprehend C code can be implemented
  186. using an expert system with only three simple rules (TABLE 9)! 
  187. This classification information is boiled down to about one to ten
  188. patterns which are reported to the final expert system application.
  189.  
  190. The final role of the expert system is to provide advice based upon
  191. the types of charts and the chart patterns present.  The advice
  192. currently provided by SPC is of a generic nature.  For example,
  193.  
  194.         "A shift up in the R chart indicates that the process is
  195.         becoming less consistent.  This may be due to some sudden
  196.         change in the process."
  197.  
  198. However, the knowledge base is designed to allow for quick
  199. modifications to provide process specific advice.  For example,
  200.  
  201.         "A shift up in the R chart has historically been associated
  202.         (90%) with a loose bearing in the preprocessing machine."
  203.  
  204.  
  205. Conventional software is used to graphically display the control
  206. charts, utilize the AIM Networks, provide an end-user interface,
  207. and integrate the entire application.
  208.  
  209.  
  210. MACHINE LEARNING
  211.  
  212. Role Of Machine Learning
  213.  
  214. The task of chart interpretation can be summarized as follows.  A
  215. control chart is simply a sequence or array of floating point
  216. numbers.  The art of chart interpretation is to determine whether
  217. or not sub-sequences similar to several standard patterns are
  218. present within the chart.  These patterns include trends, shifts,
  219. and cycles.
  220.  
  221. The function of the machine learning tool is to generate code
  222. (trained AIM Networks) which can effectively classify a specific
  223. sub-sequence of a control chart (array) according to the presence
  224. or absence of several standard patterns.  With this classification
  225. function generated by machine learning techniques, all sub-
  226. sequences of the control chart are exhaustively (conventionally)
  227. classified by five AIM Networks.  The AIM Network classification
  228. results are asserted into the fact-list of the CLIPS expert system
  229. application.
  230.  
  231. Justification For The Use Of Machine Learning Techniques
  232.  
  233. Machine learning techniques are used to classify five types of
  234. chart patterns - increasing trends, decreasing trends, shifts up,
  235. shifts down, and cycles.  We could find no references which provide
  236. an algorithm for determining whether or not a sequence of real
  237. numbers is representative of one of these patterns.  In fact, most
  238. references on control charts define these patterns by example!  The
  239. most mathematical approaches to this problem are found in
  240. references [1,2] on time series analysis and forecasting.  Despite
  241. being mathematical in nature, these references still do not
  242. describe a deterministic decision procedure.  Rather, they provide
  243. mathematical heuristics.  A sampling of these rules-of-thumb for
  244. a times series of length N are given below :
  245.  
  246.         (1) The number of increasing steps in an increasing trend
  247.         may be significantly larger than (N-1)/2.
  248.  
  249.         (2) The number of discordances in a decreasing trend is
  250.         usually larger than the expected number of discordances in
  251.         a random sequence which is N*(N-1)/4.
  252.  
  253.         (3) The autocorrelation coefficient sequence of a cycle is
  254.         usually cyclic.
  255.  
  256.         (4) The average of the first half of a shift down is always
  257.         greater than the average of the second half.
  258.  
  259. Notice that most of these heuristics are in the form of rules with
  260. confidence factors.  This would seem to suggest the possibility of
  261. using a production system for the classification procedure. 
  262. However, it is almost always the case that the pattern-type (the
  263. attribute for which we wish to determine a value) is on the left-
  264. hand side of the rule.
  265.  
  266. This is very similar to some medical diagnosis problems whose
  267. domain knowledge is in the form "Disorder A usually causes symptoms
  268. 1, 3, & 4 and may cause symptom 2."  In cases such as these, the
  269. best knowledge-based approach is to use some form of a Hypothesize-
  270. and-Test (HT) model.  Although the HT approach appears to model the
  271. domain very well, we did not pursue this option for the following
  272. reasons :
  273.  
  274.         (1) We do not have a Hypothesize-and-Test knowledge-based
  275.         development tool available for use.
  276.  
  277.         (2) To my knowledge, there are no HT systems which can be
  278.         embedded into an application in a manner similar to CLIPS.
  279.  
  280.         (3) The HT knowledge-based system approach involves the
  281.         solution of a minimal covering problem.  This would
  282.         probability cause the classification process to be
  283.         unacceptably slow.
  284.  
  285. Attempting to implement such applications using a rule-based system
  286. with confidence factors ultimately boils down to an iterative
  287. process of re-adjusting confidence factors and re-testing the rule
  288. base on a set of examples.  This iterative process, however, is
  289. quite analogous to the process of training a neural network or a
  290. machine learning tool on a set of examples.  Given this analysis
  291. and the fact that most references on control charts define these
  292. patterns by example, we elected to implement a portion of the
  293. classification process using a machine learning tool.
  294.  
  295. Representation Of Control Chart Sub-sequence
  296.  
  297. The function of the machine learning tool is to classify a specific
  298. sub-sequence of a control chart according to the presence or
  299. absence of several standard patterns.  A key question relating to
  300. the use of machine learning tools, is how do we represent an
  301. arbitrary length sub-sequence of an arbitrary length sequence of
  302. numbers as a fixed length vector of real numbers.  The approach is
  303. to represent a sub-sequence of a control chart as a fixed length
  304. vector of statistical features.
  305.  
  306. Twenty (20) statistical features are extracted from each sub-
  307. sequence X[1..N] under consideration.  Features 1 - 10 are raw
  308. statistical features while features 11 - 20 are Boolean type
  309. indicator variables.  The features and their definitions are listed
  310. in ATTACHMENT B.
  311.  
  312.  
  313. Training And Test Sets For Machine Learning Tool
  314.  
  315. Over 70,000 sample chart sub-sequences were generated to train and
  316. test the AIM Networks.  Most of these sub-sequences were generated
  317. by adding random noise to existing control charts with existing
  318. patterns.  Each chart sub-sequence generated a training/test vector
  319. of dimension 25  -  20 real-valued Network inputs (statistical
  320. features) and 5 bi-polar (-1 or 1) outputs.  One AIM Network was
  321. trained for each of the 5 outputs.  Each AIM Network required from
  322. two to six hours to train on a 386 machine with math co-processor.
  323.  
  324.  
  325.  
  326. EXPERT SYSTEM
  327.  
  328. Role Of Expert System
  329.  
  330. The role of the expert system in SPC is three-fold.  One knowledge
  331. base helps the user select the type of control chart to be used,
  332. another interprets the AIM Networks' classification results, and
  333. the third knowledge base provides expert advice on the meaning of
  334. any identified patterns.
  335.  
  336. Selecting Appropriate Control Chart Type
  337.  
  338. The knowledge base for this portion of the expert system
  339. application in SPC is given below in TABLE 7. In short, the type
  340. of control chart is selected based upon (1) whether the data is
  341. attribute data or measurement data, (2) whether the logical group
  342. size is constant or variable, and (3) whether the (attribute) data
  343. is measuring defectives or defects.
  344.  
  345. (defrule data_type
  346.    (initial-fact)
  347. =>
  348.    (ask_question "question.idx" "get_type" "data_type") )*
  349.  
  350. (defrule XBAR_R_Chart
  351.    (data_type value)
  352. =>
  353.    (assert (chart_type XBAR_R)) )
  354.  
  355. (defrule group_size
  356.    (data_type attribute)
  357. =>
  358.    (ask_question "question.idx" "get_size" "group_size")*
  359.    (ask_question "question.idx" "get_att_type" "attribute") )*
  360.  
  361. (defrule PN_Chart
  362.    (group_size constant)
  363.    (attribute defectives)
  364. =>
  365.    (assert (chart_type PN_Chart)) )
  366.  
  367. (defrule C_Chart
  368.    (group_size constant)
  369.    (attribute defects)
  370. =>
  371.    (assert (chart_type C_Chart)) )
  372.  
  373. (defrule P_Chart
  374.    (group_size variable)
  375.    (attribute defectives)
  376. =>
  377.    (assert (chart_type P_Chart)) )
  378.  
  379. (defrule _Chart
  380.    (group_size variable)
  381.    (attribute defects)
  382. =>
  383.    (assert (chart_type U_Chart)) )
  384.  
  385. *The function ask_question is provided by the CLIPS Application
  386. User Interface (AUI) also developed by the AISC at Wright-
  387. Patterson AFB, Ohio. 
  388.  
  389.  
  390. Interpreting AIM Network Classification Results
  391.  
  392. A major issue during the development of SPC was how to interpret
  393. the AIM Networks' classification results.  An example of a portion
  394. of the results of the AIM Networks' classification during the
  395. exhaustive conventional search is given in TABLE 6. The
  396. classification results of the AIM Networks are asserted into the
  397. CLIPS fact-list in the format :
  398.  
  399.         (chart-type pattern-type begin-index end-index network-
  400. score).
  401.  
  402.  
  403. ( X cycle 1 13 0.743 )
  404. ( X inc_trend 5 17 0.098 )
  405. ( X shift_up 6 18 0.282 )
  406. ( X inc_trend 6 17 0.819 )
  407. ( X inc_trend 6 16 1.000 )
  408. ( X inc_trend 7 17 0.829 )
  409. ( X inc_trend 6 15 1.000 )
  410. ( X inc_trend 7 16 0.874 )
  411. ( X inc_trend 6 14 0.991 )
  412. ( X inc_trend 7 15 1.000 )
  413. ( X inc_trend 6 13 0.951 )
  414. ( X inc_trend 7 14 1.000 )
  415. ( X inc_trend 8 15 0.973 )
  416. ( X inc_trend 6 12 0.807 )
  417. ( X inc_trend 7 13 0.997 )
  418. ( X inc_trend 8 14 0.961 )
  419. ( X inc_trend 9 15 0.841 )
  420. ( X inc_trend 7 12 0.904 )
  421. ( X inc_trend 10 15 0.917 )
  422. ( X inc_trend 10 14 0.895 )
  423.  
  424.  
  425. Notice in TABLE 6 that from points 6 to 17 there are 17 sub-
  426. sequences which the AIM increasing trend Network gave high scores
  427. to!  Clearly we cannot report to the user all 17 patterns.  The
  428. expert system application which interprets the AIM Networks'
  429. classification results is composed of three rules :
  430.  
  431.         (1) The first rule eliminates from consideration any pattern
  432.         whose AIM Network score is below a certain threshold.  The
  433.         sensitivity of the pattern recognition can be adjusted by
  434.         altering these thresholds in the deffacts statement.
  435.  
  436.         (2) The second rule eliminates from consideration any
  437.         pattern which is contained entirely within another existing
  438.         pattern of the same type.  It is assumed that the first
  439.         rule has previously been applied.  For example, the fact (X
  440.         inc_trend 8 14 0.961) would be retracted due to the presence
  441.         of the fact (X inc_trend 6 16 1.0).
  442.  
  443.         (3) The third rule eliminates from consideration any pattern
  444.         which overlaps another existing pattern of the same type but
  445.         with a higher AIM Network score.  It is assumed that the
  446.         first two rules have previously been applied.  For example,
  447.         this rule would retract the fact  (X inc_trend 8 14 0.961) 
  448.         due to the presence of the fact  (X inc_trend 7 13 0.997).
  449.  
  450. (deffacts thresholds
  451.    (threshold run 0.99)
  452.    (threshold inc_trend 0.95)
  453.    (threshold dec_trend 0.95)
  454.    (threshold shift_up 0.95)
  455.    (threshold shift_down 0.95)
  456.    (threshold stratification 0.99)
  457.    (threshold freak_point 0.99)
  458.    (threshold freak_pattern 0.99)
  459.    (threshold cycle 0.95) )
  460.    
  461.  
  462. (defrule simple_threshold
  463.    (resolve thresholds)
  464.    ?pattern <- (?chart ?type ?a ?b ?score)
  465.    (threshold ?type ?thresh)
  466.    (test (< ?score ?thresh))
  467. =>
  468.    (retract ?pattern) )
  469.    
  470.    
  471. (defrule subset
  472.    (resolve subsets)
  473.    (?chart ?type ?a1 ?b1 ?score1)
  474.    ?subset_pattern <- (?chart ?type ?a2 ?b2 ?score2)    
  475.    (test (not (and (= ?a1 ?a2) (= ?b1 ?b2))))
  476.    (test (and (<= ?a1 ?a2) (<= ?b2 ?b1) ))
  477. =>
  478.    (retract ?subset_pattern) )
  479.       
  480.  
  481. (defrule overlap   
  482.    (resolve overlap)
  483.    (?chart ?type ?a1 ?b1 ?score1)
  484.    ?pattern2 <- (?chart ?type ?a2 ?b2 ?score2)    
  485.    (test (not (and (= ?a1 ?a2) (= ?b1 ?b2))))
  486.    (test (>= ?score1 ?score2))
  487.    (test (or (and (<= ?a1 ?a2 ?b1) (< ?b1 ?b2) )
  488.              (and (<= ?a2 ?a1 ?b2) (< ?b2 ?b1) ) ))
  489. =>
  490.    (retract ?pattern2) )
  491.  
  492.  
  493. Expert Advice On Meaning Of Chart Patterns
  494.  
  495. The majority of the expert system interaction that the user will
  496. see involves explanations and advice regarding any patterns that
  497. the AIM Networks have identified as indicators of assignable causes
  498. of variation.  At the most basic level, this expert knowledge
  499. simply consists of triples of the form <chart-type, pattern-type,
  500. advice-text>.  The current AISC SPC software consists of knowledge
  501. at this level of complexity only.  A sample of the CLIPS
  502. implementation of such knowledge is illustrated in TABLE 8.
  503.  
  504. However, the rule-based representation is justified for the
  505. following reasons : 
  506.  
  507.    (1) The interpretation of control charts with multiple patterns
  508.    is more complex than simple chart-pattern-advice triples.  The
  509.    representation scheme must be powerful enough to accommodate
  510.    future enhancements to the system.
  511.  
  512.    (2) One requirement for the SPC software is that it be easily
  513.    modifiable to process specific applications.  Without knowing
  514.    what type of reasoning process might be required for such
  515.    customized applications, we selected the more flexible
  516.    representation scheme provided by a production system.
  517.  
  518.  
  519. (defrule R_shift_up
  520.    (R shift_up ?a ?b ?score)
  521. =>
  522.    (write_paragraph "advice.idx" "R_shift_up") )*
  523.  
  524. *The function write_paragraph is provided by the CLIPS Application
  525. User Interface (AUI) also developed by the AISC at Wright-Patterson
  526. AFB, Ohio. 
  527.  
  528.  
  529.  
  530. CONCLUSION
  531.  
  532. SPC is a good example of a hybrid system which integrates machine
  533. learning, expert system, and conventional programming techniques. 
  534. It is a classic example of pattern recognition and is an excellent
  535. demonstration of problem representation techniques necessary when
  536. using machine learning or neural network tools.
  537.  
  538.  
  539.  
  540. Two features distinguish SPC from most other control chart software
  541. :
  542.  
  543.         (1) SPC automatically identifies and highlights unusual
  544.         chart patterns.  Most related commercial software simply
  545.         draws the chart and explains to the user what unusual
  546.         patterns to look for.  We found no commercial software which
  547.         automatically identified trends, shifts, or cycles.
  548.  
  549.         (2) SPC provides expert advice on the meaning of all
  550.         identified unusual chart patterns.  Over 50% of available
  551.         commercial software only construct the control chart for the
  552.         user and go no further.
  553.  
  554. The first version of SPC is scheduled to be available by September
  555. 1991 and will be distributed with an AFLC sponsored course on
  556. Statistical Process Control.  The AISC plans to provide software
  557. enhancements to SPC based upon future customer feedback and demand. 
  558. Also, the AISC hopes to provide some customers with customized
  559. versions of SPC for process specific applications.  Copies of SPC
  560. and reprints of this paper are available to government agencies
  561. upon request.
  562.  
  563.  
  564. REFERENCES
  565.  
  566. [1] Spyros Makridakis and Stephen C. Wheelwright, "Forecasting:
  567. Methods and Applications",Wiley/Hamilton, 1978.
  568.  
  569. [2] Sir Maurice Kendall and J Keith Ord, "Time Series", Oxford
  570. University Press, 1990.
  571.  
  572. [3] SPC Course Materials, Decision Dynamics Inc., 1990
  573.  
  574. [4] Kaoru Ishikawa, "Guide to Quality Control", Asian Productivity
  575. Organization, 1982.
  576.  
  577. [5] Perry Johnson Inc., "SPC Chart Interpretation", Perry Johnson,
  578. Inc., 1987.
  579.  
  580. [6] J.M. Juran, Dr. Frank M. Gryna, Jr., and R.S. Bingham, Jr.,
  581. "Quality Control Handbook",Third Edition, McGraw-Hill, 1974.
  582.  
  583. [7] Western Electric Company, "Statistical Quality Control
  584. Handbook", Western Ellectric Co., Inc., 1958.
  585.  
  586. [8] H. Besterfield, "Quality Control", Second Edition, Prentice-
  587. Hall.
  588.  
  589. [9] Douglas C. Montogomery, "Introduction to Statistical Quality
  590. Control".
  591.  
  592.  
  593.  
  594.  
  595. ATTACHMENT A
  596.  
  597. Patterns To Be Identified And Methods Of Identification
  598.  
  599. (1) Freak Point  -  This is any point which falls outside of the
  600. three sigma control limits.  This is conventionally identified.
  601.  
  602. (2) Freak Pattern  -  This is any sequence of points for which a
  603. large percentage fall more than a given amount away from the mean. 
  604. This definition is vague since many experts and source materials
  605. disagree on what conditions to use.  This is conventionally
  606. identified.  The following criteria are used to identify a freak
  607. pattern:
  608.  
  609.    (a) Two out of three points in a row outside of the 2 sigma
  610.    limits.  Reference [3].
  611.    (b) Four out of five points in a row outside of the 1 sigma
  612.    limits.  Reference [3].
  613.  
  614. (3) Stratification  -  Sometimes referred to as "hugging the center
  615. line."  This is any sequence of points for which a large percentage
  616. fall less than a given amount away from the mean.  This definition
  617. is vague since many experts and source materials disagree on what
  618. conditions to use.  This is conventionally identified.  The
  619. following criteria are used to identify a stratification pattern:
  620.  
  621.    (a) Ten or more points in a row which are within the 1 sigma
  622.    limits.
  623.  
  624. (4) Runs -  This is any sequence of points for which a large
  625. percentage fall on the same side of the mean.  This definition is
  626. vague since many experts and source materials disagree on what
  627. conditions to use.  This is conventionally identified.  The
  628. following criteria are used to identify a freak pattern:
  629.  
  630.    (a) More than 5 (some say 7 and others say 8) points in a row on
  631.    the same side of the mean.
  632.  
  633.    (b) Ten of 12 on the same side of the mean.
  634.  
  635.  
  636. (5) Increasing Trends  -  This pattern is identified with C code
  637. generated by the machine learning tool AIM.  *Current accuracy is
  638. 97.5% based upon a test set of 2662 patterns.
  639.  
  640. (6) Decreasing Trends  -  This pattern is identified with C code
  641. generated by the machine learning tool AIM.  *Current accuracy is
  642. 97.3% based upon a test set of 2663 patterns.
  643.  
  644. (7) Shifts Up  -  This pattern is identified with C code generated
  645. by the machine learning tool AIM.  *Current accuracy is 98.8% based
  646. upon a test set of 1990 patterns.
  647.  
  648. (8) Shifts Down  -  This pattern is identified with C code
  649. generated by the machine learning tool AIM.  *Current accuracy is
  650. 98.8% based upon a test set of 1990 patterns.
  651.  
  652. (9) Cycles  -  This pattern is identified with C code generated by
  653. the machine learning tool AIM.  *Current accuracy is 92.0% based
  654. upon a test set of 22492 patterns.
  655.  
  656.  
  657.  
  658. * For further details, see Machine Learning Results.
  659.  
  660.  
  661.  
  662.  
  663. ATTACHMENT B
  664.  
  665. Statistical Features Used To Represent Chart Subsequences
  666.  
  667.    (1) RMS_SU  -  This is the root-mean-squared difference between
  668.    X[1..N] and an "ideal" shift-up pattern.
  669.  
  670.    (2) RMS_SD  -  This is the root-mean-squared difference between
  671.    X[1..N] and an "ideal" shift-down pattern.
  672.  
  673.    (3) A  -  This is the simple linear regression coefficient when
  674.    trying to approximate the time series X[t] using X[t] = A + Bt.
  675.  
  676.    (4) B  -  This is the simple linear regression coefficient when
  677.    trying to approximate the time series X[t] using X[t] = A + Bt.
  678.  
  679.    (5) SIGMA_1  -  This is the standard deviation of the first half
  680.    X[1..N/2] of the sequence X[1..N].
  681.  
  682.    (6) SIGMA_2  -  This is the standard deviation of the second half
  683.    X[N/2+1..N] of the sequence X[1..N].
  684.  
  685.    (7) R_root_N_r  -  The percentage of the first N/4+1
  686.    autocorrelation coefficients r(k) for which abs(r(k)) >
  687.    1.96/sqrt(N).
  688.  
  689.    (8) CHI_SQ_TEST  -  This is the Box-Pierce Q-statistic which is
  690.    capable of determining whether several autocorrelation
  691.    coefficients are significantly different from zero.  This is
  692.    defined in reference [1,p 269]
  693.  
  694.    (9) CONCORD  -  This is the number of concordances Q in X[1..N]
  695.    divided by the maximum possible number N(N-1)/2 of concordances. 
  696.    This is defined in reference [2,pp 21-23].
  697.  
  698.    (10) DISCORD  -  This is the number of discordances P in X[1..N]
  699.    divided by the maximum possible number N(N-1)/2 of discordances. 
  700.    This is defined in reference [2,pp 21-23].
  701.  
  702.  
  703.    (11) TEN_PLUS  -  An indicator variable used to indicate if
  704.    X[1..N] has length less than ten.  This is important since many
  705.    statistical significance tests are ineffective for small sample
  706.    sizes.
  707.  
  708.    (12) CCRD_LOW  -  An indicator variable used to indicate whether
  709.    CONCORD is less than 0.7.  The value of 0.7 was chosen since a
  710.    database analysis indicated that a high percentage of increasing
  711.    trends had CONCORD > 0.7.
  712.  
  713.    (13) DCRD_LOW  -  An indicator variable used to indicate whether
  714.    DISCORD is less than 0.7.  The value of 0.7 was chosen since a
  715.    database analysis indicated that a high percentage of decreasing
  716.    trends had DISCORD > 0.7.
  717.  
  718.    (14) HIGH_ISD  -  An indicator variable used to indicate whether
  719.    RMS_SD is greater than 1.8.  The value of 1.8 was chosen since
  720.    a database analysis indicated that a high percentage of shifts-
  721.    up had RMS_SD > 1.8.
  722.  
  723.    (15) HIGH_ISU  -  An indicator variable used to indicate whether
  724.    RMS_SU is greater than 1.8.  The value of 1.8 was chosen since
  725.    a database analysis indicated that a high percentage of shifts-
  726.    down had RMS_SU > 1.8.
  727.  
  728.    (16) GOOD_INC_MM  -  An indicator variable used to indicate when
  729.    the sequence minimum was early and the sequence maximum was late. 
  730.    The first 20% and last 20% was chosen since a database analysis
  731.    indicated that a high percentage of increasing trends had their
  732.    minimum and maximum within the first 20% and last 20%
  733.    respectively of the sequence.
  734.  
  735.    (17) GOOD_DEC_MM  -  An indicator variable used to indicate when
  736.    the sequence maximum was early and the sequence minimum was late. 
  737.    The first 20% and last 20% was chosen since a database analysis
  738.    indicated that a high percentage of decreasing trends had their
  739.    maximum and minimum within the first 20% and last 20%
  740.    respectively of the sequence.
  741.  
  742.    (18) HIGH_R_root_N  -  An indicator variable used to indicate
  743.    whether R_root_N_r is greater than 0.1.  The object of
  744.    introducing this variable was to help draw a distinction between
  745.    random sequences and cycles.  The value of 0.1 was chosen since
  746.    a database analysis indicated that a high percentage of cycles
  747.    and a low percentage of random sequences had R_root_N_r > 0.1.
  748.  
  749.    (19) SMALL_A  -  An indicator variable used to indicate whether
  750.    the absolute value of A is less than 0.8.  The object of
  751.    introducing this variable was to help draw a distinction between
  752.    random sequences or cycles and the other chart patterns.  The
  753.    value of 0.8 was chosen since a database analysis indicated that
  754.    a high percentage of cycles and random sequences and a low
  755.    percentage of other types of patterns had abs(A) < 0.8.
  756.  
  757.    (20)  MAYBE_CYCLE  -  An indicator variable used to indicate when
  758.    both R_root_N_r > 0.1 and ABS(A) < 0.8.  This is the logical AND
  759.    of variables 18 and 19.
  760. @
  761. (1)
  762. CONTROL CHARTS
  763.  
  764. An example of a control chart is given below in FIGURE 1.  A run
  765. chart is a plot of a process measurement (e.g. bore diameter or
  766. time to process an insurance claim for example) on the vertical
  767. axis (y-axis) against time on the horizontal axis (x-axis).  A
  768. control chart is simply a run chart with statistically determined
  769. upper (Upper Control Limit - UCL) and lower (Lower Control Limit -
  770.  LCL) lines drawn on either side of the process average.  These
  771. limits are calculated by running a process untouched, taking
  772. samples of the process measurement, and applying the appropriate
  773. statistical formulas (references [3-9]).
  774.  
  775. The random fluctuation of points within the limits results from
  776. variation built into the process.  Such random variation is
  777. natural, results from common causes within the system (e.g. design,
  778. choice of machine, preventative maintenance, etc.), and can only
  779. be affected by changing the system itself.  However, points which
  780. fall outside of the control limits or which form "unnatural"
  781. patterns indicate that some of the variation within the process may
  782. be due assignable causes.  Assignable causes of variation (e.g.
  783. measurement errors, unplanned events, freak occurrences, etc.) can
  784. be identified and result from occurrences that are not part of the
  785. process.
  786.  
  787. The purpose of drawing the control chart is to detect any unusual
  788. causes of variation in the process, signalled by abnormal points
  789. or patterns on the graph.  The AISC developed software tool
  790. automatically identifies nine types of patterns which indicate the
  791. presence of assignable causes of variation in a process.  Examples
  792. of these patterns are given in FIGURES 2 - 10.  Each such pattern
  793. is associated with generic advice about what may be happening at
  794. that point in the process.  More detailed information about each
  795. of the nine patterns is given in ATTACHMENT A.
  796. @
  797. (2)
  798. SOFTWARE FUNCTIONALITY
  799.  
  800. An overview of the functionality of the application (referred to
  801. as SPC) is given below :
  802.  
  803.         (1) SPC determines which type of control chart is
  804.         appropriate by asking a series of questions about the nature
  805.         of the user's process data.  The appropriate control chart
  806.         is selected from the following types of charts (See
  807.         References [3,4,5,6]) :
  808.  
  809.                   (a) X-Bar R Chart
  810.                   (b) p Chart
  811.                   (c) pn Chart
  812.                   (d) u Chart
  813.                   (e) c Chart
  814.  
  815.         (2) SPC graphically displays the chart(s) selected in (1).
  816.  
  817.         (3) SPC identifies the following patterns in the chart(s)
  818.         which indicate the presence of assignable causes of
  819.         variation :
  820.  
  821.                   (a) increasing trends
  822.                   (b) decreasing trends
  823.                   (c) shifts up
  824.                   (d) shifts down
  825.                   (e) cycles
  826.                   (f) runs
  827.                   (g) stratification
  828.                   (h) freak patterns
  829.                   (i) freak points
  830.  
  831.         (4) SPC graphically displays and highlights each chart
  832.         pattern  identified in (3).
  833.  
  834.         (5) SPC displays text in a window-like fashion which
  835.         provides generic advice on the meaning of each chart pattern
  836.         identified in (3).
  837.  
  838.  
  839. @
  840. (3)
  841. SOFTWARE DESIGN
  842.  
  843. The basic approach to developing SPC was to integrate machine
  844. learning, expert systems, and conventional programming techniques. 
  845. The machine learning portion of SPC was developed using the
  846. Abductory Induction Mechanism (AIM) by AbTECH Inc.  The expert
  847. system portion of SPC was developed using an embedded application
  848. of the forward chaining expert system tool CLIPS along with a
  849. generic end-user interface also developed by the AISC.  Turbo C++
  850. was used as the conventional language into which the machine
  851. learning and expert system applications were embedded.
  852.  
  853. The task for the machine learning portion of SPC is to classify
  854. every sub-sequence of the control chart according to the presence
  855. or absence of five specific chart patterns : increasing trends,
  856. decreasing trends, shifts up, shifts down, and cycles.  The
  857. remaining four chart patterns are identified by conventional
  858. methods.
  859.  
  860. The expert system is initially utilized to help the user select the
  861. appropriate type of control chart.  This determination is based
  862. upon the type of data being collected and the constancy of the
  863. sample sizes.
  864.  
  865. Another function of the expert system is to interpret the
  866. classification results of the trained AIM Network.  A control chart
  867. with 40 data points will generate over 600 classification results;
  868. with nine types of patterns this amounts to over 5500 individual
  869. pieces of classification information.  This interpretation function
  870. represents an ideal expert system application.  What requires a few
  871. hundred lines of difficult-to-comprehend C code can be implemented
  872. using an expert system with only three simple rules (TABLE 9)! 
  873. This classification information is boiled down to about one to ten
  874. patterns which are reported to the final expert system application.
  875.  
  876. The final role of the expert system is to provide advice based upon
  877. the types of charts and the chart patterns present.  The advice
  878. currently provided by SPC is of a generic nature.  For example,
  879.  
  880.         "A shift up in the R chart indicates that the process is
  881.         becoming less consistent.  This may be due to some sudden
  882.         change in the process."
  883.  
  884. However, the knowledge base is designed to allow for quick
  885. modifications to provide process specific advice.  For example,
  886.  
  887.         "A shift up in the R chart has historically been associated
  888.         (90%) with a loose bearing in the preprocessing machine."
  889.  
  890.  
  891. Conventional software is used to graphically display the control
  892. charts, utilize the AIM Networks, provide an end-user interface,
  893. and integrate the entire application.
  894.  
  895.  
  896. @
  897. (4)
  898. MACHINE LEARNING
  899.  
  900. Role Of Machine Learning
  901.  
  902. The task of chart interpretation can be summarized as follows.  A
  903. control chart is simply a sequence or array of floating point
  904. numbers.  The art of chart interpretation is to determine whether
  905. or not sub-sequences similar to several standard patterns are
  906. present within the chart.  These patterns include trends, shifts,
  907. and cycles.
  908.  
  909. The function of the machine learning tool is to generate code
  910. (trained AIM Networks) which can effectively classify a specific
  911. sub-sequence of a control chart (array) according to the presence
  912. or absence of several standard patterns.  With this classification
  913. function generated by machine learning techniques, all sub-
  914. sequences of the control chart are exhaustively (conventionally)
  915. classified by five AIM Networks.  The AIM Network classification
  916. results are asserted into the fact-list of the CLIPS expert system
  917. application.
  918.  
  919. Justification For The Use Of Machine Learning Techniques
  920.  
  921. Machine learning techniques are used to classify five types of
  922. chart patterns - increasing trends, decreasing trends, shifts up,
  923. shifts down, and cycles.  We could find no references which provide
  924. an algorithm for determining whether or not a sequence of real
  925. numbers is representative of one of these patterns.  In fact, most
  926. references on control charts define these patterns by example!  The
  927. most mathematical approaches to this problem are found in
  928. references [1,2] on time series analysis and forecasting.  Despite
  929. being mathematical in nature, these references still do not
  930. describe a deterministic decision procedure.  Rather, they provide
  931. mathematical heuristics.  A sampling of these rules-of-thumb for
  932. a times series of length N are given below :
  933.  
  934.         (1) The number of increasing steps in an increasing trend
  935.         may be significantly larger than (N-1)/2.
  936.  
  937.         (2) The number of discordances in a decreasing trend is
  938.         usually larger than the expected number of discordances in
  939.         a random sequence which is N*(N-1)/4.
  940.  
  941.         (3) The autocorrelation coefficient sequence of a cycle is
  942.         usually cyclic.
  943.  
  944.         (4) The average of the first half of a shift down is always
  945.         greater than the average of the second half.
  946.  
  947. Notice that most of these heuristics are in the form of rules with
  948. confidence factors.  This would seem to suggest the possibility of
  949. using a production system for the classification procedure. 
  950. However, it is almost always the case that the pattern-type (the
  951. attribute for which we wish to determine a value) is on the left-
  952. hand side of the rule.
  953.  
  954. This is very similar to some medical diagnosis problems whose
  955. domain knowledge is in the form "Disorder A usually causes symptoms
  956. 1, 3, & 4 and may cause symptom 2."  In cases such as these, the
  957. best knowledge-based approach is to use some form of a Hypothesize-
  958. and-Test (HT) model.  Although the HT approach appears to model the
  959. domain very well, we did not pursue this option for the following
  960. reasons :
  961.  
  962.         (1) We do not have a Hypothesize-and-Test knowledge-based
  963.         development tool available for use.
  964.  
  965.         (2) To my knowledge, there are no HT systems which can be
  966.         embedded into an application in a manner similar to CLIPS.
  967.  
  968.         (3) The HT knowledge-based system approach involves the
  969.         solution of a minimal covering problem.  This would
  970.         probability cause the classification process to be
  971.         unacceptably slow.
  972.  
  973. Attempting to implement such applications using a rule-based system
  974. with confidence factors ultimately boils down to an iterative
  975. process of re-adjusting confidence factors and re-testing the rule
  976. base on a set of examples.  This iterative process, however, is
  977. quite analogous to the process of training a neural network or a
  978. machine learning tool on a set of examples.  Given this analysis
  979. and the fact that most references on control charts define these
  980. patterns by example, we elected to implement a portion of the
  981. classification process using a machine learning tool.
  982.  
  983. Representation Of Control Chart Sub-sequence
  984.  
  985. The function of the machine learning tool is to classify a specific
  986. sub-sequence of a control chart according to the presence or
  987. absence of several standard patterns.  A key question relating to
  988. the use of machine learning tools, is how do we represent an
  989. arbitrary length sub-sequence of an arbitrary length sequence of
  990. numbers as a fixed length vector of real numbers.  The approach is
  991. to represent a sub-sequence of a control chart as a fixed length
  992. vector of statistical features.
  993.  
  994. Twenty (20) statistical features are extracted from each sub-
  995. sequence X[1..N] under consideration.  Features 1 - 10 are raw
  996. statistical features while features 11 - 20 are Boolean type
  997. indicator variables.  The features and their definitions are listed
  998. in ATTACHMENT B.
  999.  
  1000.  
  1001. Training And Test Sets For Machine Learning Tool
  1002.  
  1003. Over 70,000 sample chart sub-sequences were generated to train and
  1004. test the AIM Networks.  Most of these sub-sequences were generated
  1005. by adding random noise to existing control charts with existing
  1006. patterns.  Each chart sub-sequence generated a training/test vector
  1007. of dimension 25  -  20 real-valued Network inputs (statistical
  1008. features) and 5 bi-polar (-1 or 1) outputs.  One AIM Network was
  1009. trained for each of the 5 outputs.  Each AIM Network required from
  1010. two to six hours to train on a 386 machine with math co-processor.
  1011.  
  1012. @
  1013. (5)
  1014. EXPERT SYSTEM
  1015.  
  1016. Role Of Expert System
  1017.  
  1018. The role of the expert system in SPC is three-fold.  One knowledge
  1019. base helps the user select the type of control chart to be used,
  1020. another interprets the AIM Networks' classification results, and
  1021. the third knowledge base provides expert advice on the meaning of
  1022. any identified patterns.
  1023.  
  1024. Selecting Appropriate Control Chart Type
  1025.  
  1026. The knowledge base for this portion of the expert system
  1027. application in SPC is given below in TABLE 7. In short, the type
  1028. of control chart is selected based upon (1) whether the data is
  1029. attribute data or measurement data, (2) whether the logical group
  1030. size is constant or variable, and (3) whether the (attribute) data
  1031. is measuring defectives or defects.
  1032.  
  1033. (defrule data_type
  1034.    (initial-fact)
  1035. =>
  1036.    (ask_question "question.idx" "get_type" "data_type") )*
  1037.  
  1038. (defrule XBAR_R_Chart
  1039.    (data_type value)
  1040. =>
  1041.    (assert (chart_type XBAR_R)) )
  1042.  
  1043. (defrule group_size
  1044.    (data_type attribute)
  1045. =>
  1046.    (ask_question "question.idx" "get_size" "group_size")*
  1047.    (ask_question "question.idx" "get_att_type" "attribute") )*
  1048.  
  1049. (defrule PN_Chart
  1050.    (group_size constant)
  1051.    (attribute defectives)
  1052. =>
  1053.    (assert (chart_type PN_Chart)) )
  1054.  
  1055. (defrule C_Chart
  1056.    (group_size constant)
  1057.    (attribute defects)
  1058. =>
  1059.    (assert (chart_type C_Chart)) )
  1060.  
  1061. (defrule P_Chart
  1062.    (group_size variable)
  1063.    (attribute defectives)
  1064. =>
  1065.    (assert (chart_type P_Chart)) )
  1066.  
  1067. (defrule _Chart
  1068.    (group_size variable)
  1069.    (attribute defects)
  1070. =>
  1071.    (assert (chart_type U_Chart)) )
  1072.  
  1073. *The function ask_question is provided by the CLIPS Application
  1074. User Interface (AUI) also developed by the AISC at Wright-
  1075. Patterson AFB, Ohio. 
  1076.  
  1077.  
  1078. Interpreting AIM Network Classification Results
  1079.  
  1080. A major issue during the development of SPC was how to interpret
  1081. the AIM Networks' classification results.  An example of a portion
  1082. of the results of the AIM Networks' classification during the
  1083. exhaustive conventional search is given in TABLE 6. The
  1084. classification results of the AIM Networks are asserted into the
  1085. CLIPS fact-list in the format :
  1086.  
  1087.         (chart-type pattern-type begin-index end-index network-
  1088. score).
  1089.  
  1090.  
  1091. ( X cycle 1 13 0.743 )
  1092. ( X inc_trend 5 17 0.098 )
  1093. ( X shift_up 6 18 0.282 )
  1094. ( X inc_trend 6 17 0.819 )
  1095. ( X inc_trend 6 16 1.000 )
  1096. ( X inc_trend 7 17 0.829 )
  1097. ( X inc_trend 6 15 1.000 )
  1098. ( X inc_trend 7 16 0.874 )
  1099. ( X inc_trend 6 14 0.991 )
  1100. ( X inc_trend 7 15 1.000 )
  1101. ( X inc_trend 6 13 0.951 )
  1102. ( X inc_trend 7 14 1.000 )
  1103. ( X inc_trend 8 15 0.973 )
  1104. ( X inc_trend 6 12 0.807 )
  1105. ( X inc_trend 7 13 0.997 )
  1106. ( X inc_trend 8 14 0.961 )
  1107. ( X inc_trend 9 15 0.841 )
  1108. ( X inc_trend 7 12 0.904 )
  1109. ( X inc_trend 10 15 0.917 )
  1110. ( X inc_trend 10 14 0.895 )
  1111.  
  1112.  
  1113. Notice in TABLE 6 that from points 6 to 17 there are 17 sub-
  1114. sequences which the AIM increasing trend Network gave high scores
  1115. to!  Clearly we cannot report to the user all 17 patterns.  The
  1116. expert system application which interprets the AIM Networks'
  1117. classification results is composed of three rules :
  1118.  
  1119.         (1) The first rule eliminates from consideration any pattern
  1120.         whose AIM Network score is below a certain threshold.  The
  1121.         sensitivity of the pattern recognition can be adjusted by
  1122.         altering these thresholds in the deffacts statement.
  1123.  
  1124.         (2) The second rule eliminates from consideration any
  1125.         pattern which is contained entirely within another existing
  1126.         pattern of the same type.  It is assumed that the first
  1127.         rule has previously been applied.  For example, the fact (X
  1128.         inc_trend 8 14 0.961) would be retracted due to the presence
  1129.         of the fact (X inc_trend 6 16 1.0).
  1130.  
  1131.         (3) The third rule eliminates from consideration any pattern
  1132.         which overlaps another existing pattern of the same type but
  1133.         with a higher AIM Network score.  It is assumed that the
  1134.         first two rules have previously been applied.  For example,
  1135.         this rule would retract the fact  (X inc_trend 8 14 0.961) 
  1136.         due to the presence of the fact  (X inc_trend 7 13 0.997).
  1137.  
  1138. (deffacts thresholds
  1139.    (threshold run 0.99)
  1140.    (threshold inc_trend 0.95)
  1141.    (threshold dec_trend 0.95)
  1142.    (threshold shift_up 0.95)
  1143.    (threshold shift_down 0.95)
  1144.    (threshold stratification 0.99)
  1145.    (threshold freak_point 0.99)
  1146.    (threshold freak_pattern 0.99)
  1147.    (threshold cycle 0.95) )
  1148.    
  1149.  
  1150. (defrule simple_threshold
  1151.    (resolve thresholds)
  1152.    ?pattern <- (?chart ?type ?a ?b ?score)
  1153.    (threshold ?type ?thresh)
  1154.    (test (< ?score ?thresh))
  1155. =>
  1156.    (retract ?pattern) )
  1157.    
  1158.    
  1159. (defrule subset
  1160.    (resolve subsets)
  1161.    (?chart ?type ?a1 ?b1 ?score1)
  1162.    ?subset_pattern <- (?chart ?type ?a2 ?b2 ?score2)    
  1163.    (test (not (and (= ?a1 ?a2) (= ?b1 ?b2))))
  1164.    (test (and (<= ?a1 ?a2) (<= ?b2 ?b1) ))
  1165. =>
  1166.    (retract ?subset_pattern) )
  1167.       
  1168.  
  1169. (defrule overlap   
  1170.    (resolve overlap)
  1171.    (?chart ?type ?a1 ?b1 ?score1)
  1172.    ?pattern2 <- (?chart ?type ?a2 ?b2 ?score2)    
  1173.    (test (not (and (= ?a1 ?a2) (= ?b1 ?b2))))
  1174.    (test (>= ?score1 ?score2))
  1175.    (test (or (and (<= ?a1 ?a2 ?b1) (< ?b1 ?b2) )
  1176.              (and (<= ?a2 ?a1 ?b2) (< ?b2 ?b1) ) ))
  1177. =>
  1178.    (retract ?pattern2) )
  1179.  
  1180.  
  1181. Expert Advice On Meaning Of Chart Patterns
  1182.  
  1183. The majority of the expert system interaction that the user will
  1184. see involves explanations and advice regarding any patterns that
  1185. the AIM Networks have identified as indicators of assignable causes
  1186. of variation.  At the most basic level, this expert knowledge
  1187. simply consists of triples of the form <chart-type, pattern-type,
  1188. advice-text>.  The current AISC SPC software consists of knowledge
  1189. at this level of complexity only.  A sample of the CLIPS
  1190. implementation of such knowledge is illustrated in TABLE 8.
  1191.  
  1192. However, the rule-based representation is justified for the
  1193. following reasons : 
  1194.  
  1195.    (1) The interpretation of control charts with multiple patterns
  1196.    is more complex than simple chart-pattern-advice triples.  The
  1197.    representation scheme must be powerful enough to accommodate
  1198.    future enhancements to the system.
  1199.  
  1200.    (2) One requirement for the SPC software is that it be easily
  1201.    modifiable to process specific applications.  Without knowing
  1202.    what type of reasoning process might be required for such
  1203.    customized applications, we selected the more flexible
  1204.    representation scheme provided by a production system.
  1205.  
  1206.  
  1207. (defrule R_shift_up
  1208.    (R shift_up ?a ?b ?score)
  1209. =>
  1210.    (write_paragraph "advice.idx" "R_shift_up") )*
  1211.  
  1212. *The function write_paragraph is provided by the CLIPS Application
  1213. User Interface (AUI) also developed by the AISC at Wright-Patterson
  1214. AFB, Ohio. 
  1215.  
  1216. @
  1217. (6)
  1218. CONCLUSION
  1219.  
  1220. SPC is a good example of a hybrid system which integrates machine
  1221. learning, expert system, and conventional programming techniques. 
  1222. It is a classic example of pattern recognition and is an excellent
  1223. demonstration of problem representation techniques necessary when
  1224. using machine learning or neural network tools.
  1225.  
  1226.  
  1227.  
  1228. Two features distinguish SPC from most other control chart software
  1229. :
  1230.  
  1231.         (1) SPC automatically identifies and highlights unusual
  1232.         chart patterns.  Most related commercial software simply
  1233.         draws the chart and explains to the user what unusual
  1234.         patterns to look for.  We found no commercial software which
  1235.         automatically identified trends, shifts, or cycles.
  1236.  
  1237.         (2) SPC provides expert advice on the meaning of all
  1238.         identified unusual chart patterns.  Over 50% of available
  1239.         commercial software only construct the control chart for the
  1240.         user and go no further.
  1241.  
  1242. The first version of SPC is scheduled to be available by September
  1243. 1991 and will be distributed with an AFLC sponsored course on
  1244. Statistical Process Control.  The AISC plans to provide software
  1245. enhancements to SPC based upon future customer feedback and demand. 
  1246. Also, the AISC hopes to provide some customers with customized
  1247. versions of SPC for process specific applications.  Copies of SPC
  1248. and reprints of this paper are available to government agencies
  1249. upon request.
  1250.  
  1251. @
  1252. REFERENCES
  1253. REFERENCES
  1254.  
  1255. [1] Spyros Makridakis and Stephen C. Wheelwright, "Forecasting:
  1256. Methods and Applications",Wiley/Hamilton, 1978.
  1257.  
  1258. [2] Sir Maurice Kendall and J Keith Ord, "Time Series", Oxford
  1259. University Press, 1990.
  1260.  
  1261. [3] SPC Course Materials, Decision Dynamics Inc., 1990
  1262.  
  1263. [4] Kaoru Ishikawa, "Guide to Quality Control", Asian Productivity
  1264. Organization, 1982.
  1265.  
  1266. [5] Perry Johnson Inc., "SPC Chart Interpretation", Perry Johnson,
  1267. Inc., 1987.
  1268.  
  1269. [6] J.M. Juran, Dr. Frank M. Gryna, Jr., and R.S. Bingham, Jr.,
  1270. "Quality Control Handbook",Third Edition, McGraw-Hill, 1974.
  1271.  
  1272. [7] Western Electric Company, "Statistical Quality Control
  1273. Handbook", Western Ellectric Co., Inc., 1958.
  1274.  
  1275. [8] H. Besterfield, "Quality Control", Second Edition, Prentice-
  1276. Hall.
  1277.  
  1278. [9] Douglas C. Montogomery, "Introduction to Statistical Quality
  1279. Control".
  1280.  
  1281. @
  1282. Attachment A
  1283. ATTACHMENT A
  1284.  
  1285. Patterns To Be Identified And Methods Of Identification
  1286.  
  1287. (1) Freak Point  -  This is any point which falls outside of the
  1288. three sigma control limits.  This is conventionally identified.
  1289.  
  1290. (2) Freak Pattern  -  This is any sequence of points for which a
  1291. large percentage fall more than a given amount away from the mean. 
  1292. This definition is vague since many experts and source materials
  1293. disagree on what conditions to use.  This is conventionally
  1294. identified.  The following criteria are used to identify a freak
  1295. pattern:
  1296.  
  1297.    (a) Two out of three points in a row outside of the 2 sigma
  1298.    limits.  Reference [3].
  1299.    (b) Four out of five points in a row outside of the 1 sigma
  1300.    limits.  Reference [3].
  1301.  
  1302. (3) Stratification  -  Sometimes referred to as "hugging the center
  1303. line."  This is any sequence of points for which a large percentage
  1304. fall less than a given amount away from the mean.  This definition
  1305. is vague since many experts and source materials disagree on what
  1306. conditions to use.  This is conventionally identified.  The
  1307. following criteria are used to identify a stratification pattern:
  1308.  
  1309.    (a) Ten or more points in a row which are within the 1 sigma
  1310.    limits.
  1311.  
  1312. (4) Runs -  This is any sequence of points for which a large
  1313. percentage fall on the same side of the mean.  This definition is
  1314. vague since many experts and source materials disagree on what
  1315. conditions to use.  This is conventionally identified.  The
  1316. following criteria are used to identify a freak pattern:
  1317.  
  1318.    (a) More than 5 (some say 7 and others say 8) points in a row on
  1319.    the same side of the mean.
  1320.  
  1321.    (b) Ten of 12 on the same side of the mean.
  1322.  
  1323.  
  1324. (5) Increasing Trends  -  This pattern is identified with C code
  1325. generated by the machine learning tool AIM.  *Current accuracy is
  1326. 97.5% based upon a test set of 2662 patterns.
  1327.  
  1328. (6) Decreasing Trends  -  This pattern is identified with C code
  1329. generated by the machine learning tool AIM.  *Current accuracy is
  1330. 97.3% based upon a test set of 2663 patterns.
  1331.  
  1332. (7) Shifts Up  -  This pattern is identified with C code generated
  1333. by the machine learning tool AIM.  *Current accuracy is 98.8% based
  1334. upon a test set of 1990 patterns.
  1335.  
  1336. (8) Shifts Down  -  This pattern is identified with C code
  1337. generated by the machine learning tool AIM.  *Current accuracy is
  1338. 98.8% based upon a test set of 1990 patterns.
  1339.  
  1340. (9) Cycles  -  This pattern is identified with C code generated by
  1341. the machine learning tool AIM.  *Current accuracy is 92.0% based
  1342. upon a test set of 22492 patterns.
  1343.  
  1344.  
  1345.  
  1346. * For further details, see Machine Learning Results.
  1347.  
  1348. @
  1349. Attachment B
  1350. ATTACHMENT B
  1351.  
  1352. Statistical Features Used To Represent Chart Subsequences
  1353.  
  1354.    (1) RMS_SU  -  This is the root-mean-squared difference between
  1355.    X[1..N] and an "ideal" shift-up pattern.
  1356.  
  1357.    (2) RMS_SD  -  This is the root-mean-squared difference between
  1358.    X[1..N] and an "ideal" shift-down pattern.
  1359.  
  1360.    (3) A  -  This is the simple linear regression coefficient when
  1361.    trying to approximate the time series X[t] using X[t] = A + Bt.
  1362.  
  1363.    (4) B  -  This is the simple linear regression coefficient when
  1364.    trying to approximate the time series X[t] using X[t] = A + Bt.
  1365.  
  1366.    (5) SIGMA_1  -  This is the standard deviation of the first half
  1367.    X[1..N/2] of the sequence X[1..N].
  1368.  
  1369.    (6) SIGMA_2  -  This is the standard deviation of the second half
  1370.    X[N/2+1..N] of the sequence X[1..N].
  1371.  
  1372.    (7) R_root_N_r  -  The percentage of the first N/4+1
  1373.    autocorrelation coefficients r(k) for which abs(r(k)) >
  1374.    1.96/sqrt(N).
  1375.  
  1376.    (8) CHI_SQ_TEST  -  This is the Box-Pierce Q-statistic which is
  1377.    capable of determining whether several autocorrelation
  1378.    coefficients are significantly different from zero.  This is
  1379.    defined in reference [1,p 269]
  1380.  
  1381.    (9) CONCORD  -  This is the number of concordances Q in X[1..N]
  1382.    divided by the maximum possible number N(N-1)/2 of concordances. 
  1383.    This is defined in reference [2,pp 21-23].
  1384.  
  1385.    (10) DISCORD  -  This is the number of discordances P in X[1..N]
  1386.    divided by the maximum possible number N(N-1)/2 of discordances. 
  1387.    This is defined in reference [2,pp 21-23].
  1388.  
  1389.  
  1390.    (11) TEN_PLUS  -  An indicator variable used to indicate if
  1391.    X[1..N] has length less than ten.  This is important since many
  1392.    statistical significance tests are ineffective for small sample
  1393.    sizes.
  1394.  
  1395.    (12) CCRD_LOW  -  An indicator variable used to indicate whether
  1396.    CONCORD is less than 0.7.  The value of 0.7 was chosen since a
  1397.    database analysis indicated that a high percentage of increasing
  1398.    trends had CONCORD > 0.7.
  1399.  
  1400.    (13) DCRD_LOW  -  An indicator variable used to indicate whether
  1401.    DISCORD is less than 0.7.  The value of 0.7 was chosen since a
  1402.    database analysis indicated that a high percentage of decreasing
  1403.    trends had DISCORD > 0.7.
  1404.  
  1405.    (14) HIGH_ISD  -  An indicator variable used to indicate whether
  1406.    RMS_SD is greater than 1.8.  The value of 1.8 was chosen since
  1407.    a database analysis indicated that a high percentage of shifts-
  1408.    up had RMS_SD > 1.8.
  1409.  
  1410.    (15) HIGH_ISU  -  An indicator variable used to indicate whether
  1411.    RMS_SU is greater than 1.8.  The value of 1.8 was chosen since
  1412.    a database analysis indicated that a high percentage of shifts-
  1413.    down had RMS_SU > 1.8.
  1414.  
  1415.    (16) GOOD_INC_MM  -  An indicator variable used to indicate when
  1416.    the sequence minimum was early and the sequence maximum was late. 
  1417.    The first 20% and last 20% was chosen since a database analysis
  1418.    indicated that a high percentage of increasing trends had their
  1419.    minimum and maximum within the first 20% and last 20%
  1420.    respectively of the sequence.
  1421.  
  1422.    (17) GOOD_DEC_MM  -  An indicator variable used to indicate when
  1423.    the sequence maximum was early and the sequence minimum was late. 
  1424.    The first 20% and last 20% was chosen since a database analysis
  1425.    indicated that a high percentage of decreasing trends had their
  1426.    maximum and minimum within the first 20% and last 20%
  1427.    respectively of the sequence.
  1428.  
  1429.    (18) HIGH_R_root_N  -  An indicator variable used to indicate
  1430.    whether R_root_N_r is greater than 0.1.  The object of
  1431.    introducing this variable was to help draw a distinction between
  1432.    random sequences and cycles.  The value of 0.1 was chosen since
  1433.    a database analysis indicated that a high percentage of cycles
  1434.    and a low percentage of random sequences had R_root_N_r > 0.1.
  1435.  
  1436.    (19) SMALL_A  -  An indicator variable used to indicate whether
  1437.    the absolute value of A is less than 0.8.  The object of
  1438.    introducing this variable was to help draw a distinction between
  1439.    random sequences or cycles and the other chart patterns.  The
  1440.    value of 0.8 was chosen since a database analysis indicated that
  1441.    a high percentage of cycles and random sequences and a low
  1442.    percentage of other types of patterns had abs(A) < 0.8.
  1443.  
  1444.    (20)  MAYBE_CYCLE  -  An indicator variable used to indicate when
  1445.    both R_root_N_r > 0.1 and ABS(A) < 0.8.  This is the logical AND
  1446.    of variables 18 and 19.
  1447.  
  1448. @
  1449. Mark Shewhart
  1450.        About the Author
  1451.  
  1452. Mark Shewhart
  1453. Air Force Logistics Command (AFLC)
  1454. Acquisition Logistics Division
  1455. Joint Technology Application Office (ALD/JTI)
  1456. Artificial Intelligence Support Center (AISC)
  1457. Wright Patterson AFB, Ohio 45433
  1458. @
  1459. (-)
  1460. Abstract.  Statistical Process Control (SPC) Charts are one
  1461. of several tools used in Quality Control.  Other tools
  1462. include flow charts, histograms, cause-and-effect diagrams,
  1463. check sheets, Pareto diagrams, graphs, and scatter diagrams. 
  1464. A control chart is simply a graph which indicates process
  1465. variation over time.  The purpose of drawing a control chart
  1466. is to detect any changes in the process, signalled by
  1467. abnormal points or patterns on the graph.  The Artificial
  1468. Intelligence Support Center (AISC) of the Acquisition
  1469. Logistics Division (ALD/JTI) has developed a hybrid machine-
  1470. learning/expert-system prototype which automates the process
  1471. of constructing and interpreting control charts.
  1472. @
  1473. (0)
  1474. INTRODUCTION
  1475.  
  1476. The Air Force Logistics Command (AFLC) has provided TQM and Quality
  1477. Control training to its employees for several years now.  In
  1478. particular, Statistical Process Control has been emphasized in this
  1479. effort.  While many data collection efforts have been undertaken
  1480. within AFLC, the SPC Quality Control tool has been under-utilized
  1481. due to the lack of experienced personnel to identify and interpret
  1482. patterns within the control charts.  The AISC has developed a
  1483. prototype software tool which draws control charts, identifies
  1484. various chart patterns, advises what each pattern means, and
  1485. suggests possible corrective actions.  The application is easily
  1486. modifiable for process specific applications through simple
  1487. modifications to the knowledge base portion using any word
  1488. processing software.
  1489.  
  1490. The remainder of this paper consists  of the following sections :
  1491.  
  1492.         #m(1)#m CONTROL CHARTS
  1493.         #m(2)#m SOFTWARE FUNCTIONALITY
  1494.         #m(3)#m SOFTWARE DESIGN
  1495.         #m(4)#m MACHINE LEARNING
  1496.         #m(5)#m EXPERT SYSTEM
  1497.         #m(6)#m CONCLUSION
  1498.         #mREFERENCES#m        
  1499.         #mAttachment A#m
  1500.         #mAttachment B#m
  1501.  
  1502. Section (1) provides a more in-depth explanation of the purpose of
  1503. control charts.  Section (2) details the initial functional
  1504. requirements for the SPC software, and section (3) outlines the
  1505. design approach used to implement the system requirements. 
  1506. Sections (4) and (5) examine in detail the roles of machine
  1507. learning and expert system techniques respectively.  Finally,
  1508. section (6) offers some basic conclusions resulting from this
  1509. effort.   Two attachments are included after the references. 
  1510. ATTACHMENT A provides a list of the chart patterns of interest and
  1511. their methods of identification.  ATTACHMENT B enumerates and
  1512. explains the twenty statistical features used by the machine
  1513. learning tool.
  1514. @